import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: Andrey
 * Date: 08.04.13
 * Time: 13:54
 * To change this template use File | Settings | File Templates.
 */

public class Delenie
{
    public static void main(String[] args)
    {
        int a;
        int b;
        System.out.println("Ведите делимое: ");
        Scanner consoleA = new Scanner(System.in);
        a = consoleA.nextInt();
        System.out.println("Ведите делитель: ");
        Scanner consoleB = new Scanner(System.in);
        b = consoleB.nextInt();

        int c = a/b;
        int d = a%b;
        int[] dk = new int[10];

        System.out.print("a = "+a+"\n"+"b = "+b+"\n"+"a/b = "+c+".");

        dk[0]=d;
        if(d<b){d = d*10;}
        c = d/b;
        d = d%b;
        System.out.print(c);

        if(d!=dk[0])
        {
            dk[1]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }

        if(d!=dk[0]& d!=dk[1])
        {
            dk[2]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }

        if(d!=dk[0]& d!=dk[1]&d!=dk[2])
        {
            dk[3]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }

        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4])
        {
            dk[4]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }

        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4]&d!=dk[5])
        {
            dk[5]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }
        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4]&d!=dk[5]&d!=dk[6])
        {
            dk[6]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }
        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4]&d!=dk[5]&d!=dk[6]&d!=dk[7])
        {
            dk[7]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }
        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4]&d!=dk[5]&d!=dk[6]&d!=dk[7]&d!=dk[8])
        {
            dk[8]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }
        if(d!=dk[0]&d!=dk[1]&d!=dk[2]&d!=dk[3]&d!=dk[4]&d!=dk[5]&d!=dk[6]&d!=dk[7]&d!=dk[8]&d!=dk[9])
        {
            dk[9]=d;
            if(d<b){d = d*10;}
            c = d/b;
            d = d%b;
            System.out.print(c);
        }
    }
}



